#ifndef GLOBAL_H
#define GLOBAL_H

/** \file global.h
 * \brief Global declarations
 *
 * Contains declarations of common types, constants, etc. used by different
 * modules.
 */

// OS constants

#ifndef SOLARIS
#if defined (__SVR4) && defined (__sun)
#define SOLARIS
#endif
#endif

#ifndef LINUX
#if defined (__linux)
#define LINUX
#endif
#endif


#ifdef SOLARIS
#include <stddef.h>
#else
#include <stdint.h>
#endif

#include <sys/types.h>

#include <netinet/in.h>

#ifndef NULL
#define NULL ((void*)0)
#endif


//#ifndef off_t
//typedef long off_t;
//#endif

/// File key (ID)
typedef char filekey_t[32];

/// Transfer speed, in seconds
typedef uint32_t speed_t;


/// IP type
typedef unsigned char ip_t[4];

/// IP-port type
typedef struct _ip_port_s
{
  ip_t       ip;
  in_port_t  port;
} ip_port_s;


#endif

